Skip to content

Commit 650fba0

Browse files
committed
Updated: 2025-01-30
1 parent 13ed740 commit 650fba0

7 files changed

Lines changed: 28 additions & 8 deletions

File tree

docs/CreateDns.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Name | Type | Description | Notes
88
**subdomain** | **object** | Полное имя поддомена. | [optional]
99
**type** | **object** | Тип DNS-записи. |
1010
**value** | **object** | Значение DNS-записи. |
11+
**ttl** | **object** | Время жизни DNS-записи. | [optional]
1112

1213
## Example
1314

docs/DnsRecord.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Name | Type | Description | Notes
88
**type** | **object** | Тип DNS-записи. |
99
**id** | **object** | ID DNS-записи. | [optional]
1010
**data** | [**DnsRecordData**](DnsRecordData.md) | |
11+
**ttl** | **object** | Время жизни DNS-записи. | [optional]
1112

1213
## Example
1314

test/test_create_dns.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ def make_instance(self, include_optional):
4242
priority = 0,
4343
subdomain = sub.somedomain.ru,
4444
type = A,
45-
value = 192.168.111.123
45+
value = 192.168.111.123,
46+
ttl = 600
4647
)
4748
else :
4849
return CreateDns(

test/test_create_domain_dns_record201_response.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ def make_instance(self, include_optional):
4545
data = timeweb_cloud_api.models.dns_record_data.dns_record_data(
4646
priority = 0,
4747
subdomain = sub.somedomain.ru,
48-
value = 98.76.54.32, ), )
48+
value = 98.76.54.32, ),
49+
ttl = 600, )
4950
)
5051
else :
5152
return CreateDomainDNSRecord201Response(
@@ -55,7 +56,8 @@ def make_instance(self, include_optional):
5556
data = timeweb_cloud_api.models.dns_record_data.dns_record_data(
5657
priority = 0,
5758
subdomain = sub.somedomain.ru,
58-
value = 98.76.54.32, ), ),
59+
value = 98.76.54.32, ),
60+
ttl = 600, ),
5961
)
6062
"""
6163

test/test_dns_record.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ def make_instance(self, include_optional):
4444
data = timeweb_cloud_api.models.dns_record_data.dns_record_data(
4545
priority = 0,
4646
subdomain = sub.somedomain.ru,
47-
value = 98.76.54.32, )
47+
value = 98.76.54.32, ),
48+
ttl = 600
4849
)
4950
else :
5051
return DnsRecord(

timeweb_cloud_api/models/create_dns.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ class CreateDns(BaseModel):
3030
subdomain: Optional[Any] = Field(None, description="Полное имя поддомена.")
3131
type: Optional[Any] = Field(..., description="Тип DNS-записи.")
3232
value: Optional[Any] = Field(..., description="Значение DNS-записи.")
33-
__properties = ["priority", "subdomain", "type", "value"]
33+
ttl: Optional[Any] = Field(None, description="Время жизни DNS-записи.")
34+
__properties = ["priority", "subdomain", "type", "value", "ttl"]
3435

3536
@validator('type')
3637
def type_validate_enum(cls, value):
@@ -86,6 +87,11 @@ def to_dict(self):
8687
if self.value is None and "value" in self.__fields_set__:
8788
_dict['value'] = None
8889

90+
# set to None if ttl (nullable) is None
91+
# and __fields_set__ contains the field
92+
if self.ttl is None and "ttl" in self.__fields_set__:
93+
_dict['ttl'] = None
94+
8995
return _dict
9096

9197
@classmethod
@@ -101,7 +107,8 @@ def from_dict(cls, obj: dict) -> CreateDns:
101107
"priority": obj.get("priority"),
102108
"subdomain": obj.get("subdomain"),
103109
"type": obj.get("type"),
104-
"value": obj.get("value")
110+
"value": obj.get("value"),
111+
"ttl": obj.get("ttl")
105112
})
106113
return _obj
107114

timeweb_cloud_api/models/dns_record.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ class DnsRecord(BaseModel):
3030
type: Optional[Any] = Field(..., description="Тип DNS-записи.")
3131
id: Optional[Any] = Field(None, description="ID DNS-записи.")
3232
data: DnsRecordData = Field(...)
33-
__properties = ["type", "id", "data"]
33+
ttl: Optional[Any] = Field(None, description="Время жизни DNS-записи.")
34+
__properties = ["type", "id", "data", "ttl"]
3435

3536
@validator('type')
3637
def type_validate_enum(cls, value):
@@ -79,6 +80,11 @@ def to_dict(self):
7980
if self.id is None and "id" in self.__fields_set__:
8081
_dict['id'] = None
8182

83+
# set to None if ttl (nullable) is None
84+
# and __fields_set__ contains the field
85+
if self.ttl is None and "ttl" in self.__fields_set__:
86+
_dict['ttl'] = None
87+
8288
return _dict
8389

8490
@classmethod
@@ -93,7 +99,8 @@ def from_dict(cls, obj: dict) -> DnsRecord:
9399
_obj = DnsRecord.parse_obj({
94100
"type": obj.get("type"),
95101
"id": obj.get("id"),
96-
"data": DnsRecordData.from_dict(obj.get("data")) if obj.get("data") is not None else None
102+
"data": DnsRecordData.from_dict(obj.get("data")) if obj.get("data") is not None else None,
103+
"ttl": obj.get("ttl")
97104
})
98105
return _obj
99106

0 commit comments

Comments
 (0)