Skip to content

Commit 80375da

Browse files
authored
feat(webhosting): add addon domains limit to public Product (#290)
1 parent a47c8a7 commit 80375da

File tree

4 files changed

+102
-44
lines changed

4 files changed

+102
-44
lines changed

scaleway-async/scaleway_async/webhosting/v1alpha1/marshalling.py

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525

2626

2727
def unmarshal_HostingCpanelUrls(data: Any) -> HostingCpanelUrls:
28-
if not isinstance(data, dict):
28+
if type(data) is not dict:
2929
raise TypeError(
30-
"Unmarshalling the type 'HostingCpanelUrls' failed as data isn't a dictionary."
30+
f"Unmarshalling the type 'HostingCpanelUrls' failed as data isn't a dictionary."
3131
)
3232

3333
args: Dict[str, Any] = {}
@@ -42,9 +42,9 @@ def unmarshal_HostingCpanelUrls(data: Any) -> HostingCpanelUrls:
4242

4343

4444
def unmarshal_HostingOption(data: Any) -> HostingOption:
45-
if not isinstance(data, dict):
45+
if type(data) is not dict:
4646
raise TypeError(
47-
"Unmarshalling the type 'HostingOption' failed as data isn't a dictionary."
47+
f"Unmarshalling the type 'HostingOption' failed as data isn't a dictionary."
4848
)
4949

5050
args: Dict[str, Any] = {}
@@ -59,9 +59,9 @@ def unmarshal_HostingOption(data: Any) -> HostingOption:
5959

6060

6161
def unmarshal_OfferProduct(data: Any) -> OfferProduct:
62-
if not isinstance(data, dict):
62+
if type(data) is not dict:
6363
raise TypeError(
64-
"Unmarshalling the type 'OfferProduct' failed as data isn't a dictionary."
64+
f"Unmarshalling the type 'OfferProduct' failed as data isn't a dictionary."
6565
)
6666

6767
args: Dict[str, Any] = {}
@@ -78,6 +78,9 @@ def unmarshal_OfferProduct(data: Any) -> OfferProduct:
7878
field = data.get("hosting_storage_quota", None)
7979
args["hosting_storage_quota"] = field
8080

81+
field = data.get("max_addon_domains", None)
82+
args["max_addon_domains"] = field
83+
8184
field = data.get("name", None)
8285
args["name"] = field
8386

@@ -97,9 +100,9 @@ def unmarshal_OfferProduct(data: Any) -> OfferProduct:
97100

98101

99102
def unmarshal_DnsRecord(data: Any) -> DnsRecord:
100-
if not isinstance(data, dict):
103+
if type(data) is not dict:
101104
raise TypeError(
102-
"Unmarshalling the type 'DnsRecord' failed as data isn't a dictionary."
105+
f"Unmarshalling the type 'DnsRecord' failed as data isn't a dictionary."
103106
)
104107

105108
args: Dict[str, Any] = {}
@@ -126,9 +129,9 @@ def unmarshal_DnsRecord(data: Any) -> DnsRecord:
126129

127130

128131
def unmarshal_Hosting(data: Any) -> Hosting:
129-
if not isinstance(data, dict):
132+
if type(data) is not dict:
130133
raise TypeError(
131-
"Unmarshalling the type 'Hosting' failed as data isn't a dictionary."
134+
f"Unmarshalling the type 'Hosting' failed as data isn't a dictionary."
132135
)
133136

134137
args: Dict[str, Any] = {}
@@ -139,7 +142,7 @@ def unmarshal_Hosting(data: Any) -> Hosting:
139142
)
140143

141144
field = data.get("created_at", None)
142-
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
145+
args["created_at"] = parser.isoparse(field) if type(field) is str else field
143146

144147
field = data.get("dns_status", None)
145148
args["dns_status"] = field
@@ -186,7 +189,7 @@ def unmarshal_Hosting(data: Any) -> Hosting:
186189
args["tags"] = field
187190

188191
field = data.get("updated_at", None)
189-
args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field
192+
args["updated_at"] = parser.isoparse(field) if type(field) is str else field
190193

191194
field = data.get("username", None)
192195
args["username"] = field
@@ -195,9 +198,9 @@ def unmarshal_Hosting(data: Any) -> Hosting:
195198

196199

197200
def unmarshal_Nameserver(data: Any) -> Nameserver:
198-
if not isinstance(data, dict):
201+
if type(data) is not dict:
199202
raise TypeError(
200-
"Unmarshalling the type 'Nameserver' failed as data isn't a dictionary."
203+
f"Unmarshalling the type 'Nameserver' failed as data isn't a dictionary."
201204
)
202205

203206
args: Dict[str, Any] = {}
@@ -215,9 +218,9 @@ def unmarshal_Nameserver(data: Any) -> Nameserver:
215218

216219

217220
def unmarshal_Offer(data: Any) -> Offer:
218-
if not isinstance(data, dict):
221+
if type(data) is not dict:
219222
raise TypeError(
220-
"Unmarshalling the type 'Offer' failed as data isn't a dictionary."
223+
f"Unmarshalling the type 'Offer' failed as data isn't a dictionary."
221224
)
222225

223226
args: Dict[str, Any] = {}
@@ -247,9 +250,9 @@ def unmarshal_Offer(data: Any) -> Offer:
247250

248251

249252
def unmarshal_DnsRecords(data: Any) -> DnsRecords:
250-
if not isinstance(data, dict):
253+
if type(data) is not dict:
251254
raise TypeError(
252-
"Unmarshalling the type 'DnsRecords' failed as data isn't a dictionary."
255+
f"Unmarshalling the type 'DnsRecords' failed as data isn't a dictionary."
253256
)
254257

255258
args: Dict[str, Any] = {}
@@ -271,9 +274,9 @@ def unmarshal_DnsRecords(data: Any) -> DnsRecords:
271274

272275

273276
def unmarshal_ListHostingsResponse(data: Any) -> ListHostingsResponse:
274-
if not isinstance(data, dict):
277+
if type(data) is not dict:
275278
raise TypeError(
276-
"Unmarshalling the type 'ListHostingsResponse' failed as data isn't a dictionary."
279+
f"Unmarshalling the type 'ListHostingsResponse' failed as data isn't a dictionary."
277280
)
278281

279282
args: Dict[str, Any] = {}
@@ -290,9 +293,9 @@ def unmarshal_ListHostingsResponse(data: Any) -> ListHostingsResponse:
290293

291294

292295
def unmarshal_ListOffersResponse(data: Any) -> ListOffersResponse:
293-
if not isinstance(data, dict):
296+
if type(data) is not dict:
294297
raise TypeError(
295-
"Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary."
298+
f"Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary."
296299
)
297300

298301
args: Dict[str, Any] = {}

scaleway-async/scaleway_async/webhosting/v1alpha1/types.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,18 +393,44 @@ class OfferProduct:
393393
"""
394394

395395
email_accounts_quota: int
396+
"""
397+
Limit number of email accounts.
398+
"""
396399

397400
email_storage_quota: int
401+
"""
402+
Limit quantity of email storage in gigabytes.
403+
"""
398404

399405
databases_quota: int
406+
"""
407+
Limit number of databases.
408+
"""
400409

401410
hosting_storage_quota: int
411+
"""
412+
Limit quantity of hosting storage in gigabytes.
413+
"""
402414

403415
support_included: bool
416+
"""
417+
Whether or not support is included.
418+
"""
404419

405420
v_cpu: int
421+
"""
422+
Limit number of virtual CPU.
423+
"""
406424

407425
ram: int
426+
"""
427+
Limit quantity of memory in gigabytes.
428+
"""
429+
430+
max_addon_domains: int
431+
"""
432+
Limit number of add-on domains.
433+
"""
408434

409435

410436
@dataclass

scaleway/scaleway/webhosting/v1alpha1/marshalling.py

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525

2626

2727
def unmarshal_HostingCpanelUrls(data: Any) -> HostingCpanelUrls:
28-
if not isinstance(data, dict):
28+
if type(data) is not dict:
2929
raise TypeError(
30-
"Unmarshalling the type 'HostingCpanelUrls' failed as data isn't a dictionary."
30+
f"Unmarshalling the type 'HostingCpanelUrls' failed as data isn't a dictionary."
3131
)
3232

3333
args: Dict[str, Any] = {}
@@ -42,9 +42,9 @@ def unmarshal_HostingCpanelUrls(data: Any) -> HostingCpanelUrls:
4242

4343

4444
def unmarshal_HostingOption(data: Any) -> HostingOption:
45-
if not isinstance(data, dict):
45+
if type(data) is not dict:
4646
raise TypeError(
47-
"Unmarshalling the type 'HostingOption' failed as data isn't a dictionary."
47+
f"Unmarshalling the type 'HostingOption' failed as data isn't a dictionary."
4848
)
4949

5050
args: Dict[str, Any] = {}
@@ -59,9 +59,9 @@ def unmarshal_HostingOption(data: Any) -> HostingOption:
5959

6060

6161
def unmarshal_OfferProduct(data: Any) -> OfferProduct:
62-
if not isinstance(data, dict):
62+
if type(data) is not dict:
6363
raise TypeError(
64-
"Unmarshalling the type 'OfferProduct' failed as data isn't a dictionary."
64+
f"Unmarshalling the type 'OfferProduct' failed as data isn't a dictionary."
6565
)
6666

6767
args: Dict[str, Any] = {}
@@ -78,6 +78,9 @@ def unmarshal_OfferProduct(data: Any) -> OfferProduct:
7878
field = data.get("hosting_storage_quota", None)
7979
args["hosting_storage_quota"] = field
8080

81+
field = data.get("max_addon_domains", None)
82+
args["max_addon_domains"] = field
83+
8184
field = data.get("name", None)
8285
args["name"] = field
8386

@@ -97,9 +100,9 @@ def unmarshal_OfferProduct(data: Any) -> OfferProduct:
97100

98101

99102
def unmarshal_DnsRecord(data: Any) -> DnsRecord:
100-
if not isinstance(data, dict):
103+
if type(data) is not dict:
101104
raise TypeError(
102-
"Unmarshalling the type 'DnsRecord' failed as data isn't a dictionary."
105+
f"Unmarshalling the type 'DnsRecord' failed as data isn't a dictionary."
103106
)
104107

105108
args: Dict[str, Any] = {}
@@ -126,9 +129,9 @@ def unmarshal_DnsRecord(data: Any) -> DnsRecord:
126129

127130

128131
def unmarshal_Hosting(data: Any) -> Hosting:
129-
if not isinstance(data, dict):
132+
if type(data) is not dict:
130133
raise TypeError(
131-
"Unmarshalling the type 'Hosting' failed as data isn't a dictionary."
134+
f"Unmarshalling the type 'Hosting' failed as data isn't a dictionary."
132135
)
133136

134137
args: Dict[str, Any] = {}
@@ -139,7 +142,7 @@ def unmarshal_Hosting(data: Any) -> Hosting:
139142
)
140143

141144
field = data.get("created_at", None)
142-
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
145+
args["created_at"] = parser.isoparse(field) if type(field) is str else field
143146

144147
field = data.get("dns_status", None)
145148
args["dns_status"] = field
@@ -186,7 +189,7 @@ def unmarshal_Hosting(data: Any) -> Hosting:
186189
args["tags"] = field
187190

188191
field = data.get("updated_at", None)
189-
args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field
192+
args["updated_at"] = parser.isoparse(field) if type(field) is str else field
190193

191194
field = data.get("username", None)
192195
args["username"] = field
@@ -195,9 +198,9 @@ def unmarshal_Hosting(data: Any) -> Hosting:
195198

196199

197200
def unmarshal_Nameserver(data: Any) -> Nameserver:
198-
if not isinstance(data, dict):
201+
if type(data) is not dict:
199202
raise TypeError(
200-
"Unmarshalling the type 'Nameserver' failed as data isn't a dictionary."
203+
f"Unmarshalling the type 'Nameserver' failed as data isn't a dictionary."
201204
)
202205

203206
args: Dict[str, Any] = {}
@@ -215,9 +218,9 @@ def unmarshal_Nameserver(data: Any) -> Nameserver:
215218

216219

217220
def unmarshal_Offer(data: Any) -> Offer:
218-
if not isinstance(data, dict):
221+
if type(data) is not dict:
219222
raise TypeError(
220-
"Unmarshalling the type 'Offer' failed as data isn't a dictionary."
223+
f"Unmarshalling the type 'Offer' failed as data isn't a dictionary."
221224
)
222225

223226
args: Dict[str, Any] = {}
@@ -247,9 +250,9 @@ def unmarshal_Offer(data: Any) -> Offer:
247250

248251

249252
def unmarshal_DnsRecords(data: Any) -> DnsRecords:
250-
if not isinstance(data, dict):
253+
if type(data) is not dict:
251254
raise TypeError(
252-
"Unmarshalling the type 'DnsRecords' failed as data isn't a dictionary."
255+
f"Unmarshalling the type 'DnsRecords' failed as data isn't a dictionary."
253256
)
254257

255258
args: Dict[str, Any] = {}
@@ -271,9 +274,9 @@ def unmarshal_DnsRecords(data: Any) -> DnsRecords:
271274

272275

273276
def unmarshal_ListHostingsResponse(data: Any) -> ListHostingsResponse:
274-
if not isinstance(data, dict):
277+
if type(data) is not dict:
275278
raise TypeError(
276-
"Unmarshalling the type 'ListHostingsResponse' failed as data isn't a dictionary."
279+
f"Unmarshalling the type 'ListHostingsResponse' failed as data isn't a dictionary."
277280
)
278281

279282
args: Dict[str, Any] = {}
@@ -290,9 +293,9 @@ def unmarshal_ListHostingsResponse(data: Any) -> ListHostingsResponse:
290293

291294

292295
def unmarshal_ListOffersResponse(data: Any) -> ListOffersResponse:
293-
if not isinstance(data, dict):
296+
if type(data) is not dict:
294297
raise TypeError(
295-
"Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary."
298+
f"Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary."
296299
)
297300

298301
args: Dict[str, Any] = {}

scaleway/scaleway/webhosting/v1alpha1/types.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,18 +393,44 @@ class OfferProduct:
393393
"""
394394

395395
email_accounts_quota: int
396+
"""
397+
Limit number of email accounts.
398+
"""
396399

397400
email_storage_quota: int
401+
"""
402+
Limit quantity of email storage in gigabytes.
403+
"""
398404

399405
databases_quota: int
406+
"""
407+
Limit number of databases.
408+
"""
400409

401410
hosting_storage_quota: int
411+
"""
412+
Limit quantity of hosting storage in gigabytes.
413+
"""
402414

403415
support_included: bool
416+
"""
417+
Whether or not support is included.
418+
"""
404419

405420
v_cpu: int
421+
"""
422+
Limit number of virtual CPU.
423+
"""
406424

407425
ram: int
426+
"""
427+
Limit quantity of memory in gigabytes.
428+
"""
429+
430+
max_addon_domains: int
431+
"""
432+
Limit number of add-on domains.
433+
"""
408434

409435

410436
@dataclass

0 commit comments

Comments
 (0)