Skip to content

Commit 999f478

Browse files
author
BitsAdmin
committed
Merge branch 'mcdn-Python-2022-03-01-online-939-2025_01_15_14_07_18' into 'integration_2025-01-16_675380848130'
feat: [development task] mcdn-939-Python (978342) See merge request iaasng/volcengine-python-sdk!489
2 parents 2e983d6 + 02c954d commit 999f478

File tree

5 files changed

+428
-0
lines changed

5 files changed

+428
-0
lines changed

volcenginesdkmcdn/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@
137137
from volcenginesdkmcdn.models.static_weight_for_describe_dns_schedule_static_weights_output import StaticWeightForDescribeDnsScheduleStaticWeightsOutput
138138
from volcenginesdkmcdn.models.sub_task_for_describe_content_task_by_task_id_output import SubTaskForDescribeContentTaskByTaskIdOutput
139139
from volcenginesdkmcdn.models.sub_task_for_list_content_tasks_output import SubTaskForListContentTasksOutput
140+
from volcenginesdkmcdn.models.submit_oversea_preload_task_request import SubmitOverseaPreloadTaskRequest
141+
from volcenginesdkmcdn.models.submit_oversea_preload_task_response import SubmitOverseaPreloadTaskResponse
140142
from volcenginesdkmcdn.models.submit_preload_task_request import SubmitPreloadTaskRequest
141143
from volcenginesdkmcdn.models.submit_preload_task_response import SubmitPreloadTaskResponse
142144
from volcenginesdkmcdn.models.submit_refresh_task_request import SubmitRefreshTaskRequest

volcenginesdkmcdn/api/mcdn_api.py

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2167,6 +2167,103 @@ def list_views_with_http_info(self, body, **kwargs): # noqa: E501
21672167
_request_timeout=params.get('_request_timeout'),
21682168
collection_formats=collection_formats)
21692169

2170+
def submit_oversea_preload_task(self, body, **kwargs): # noqa: E501
2171+
"""submit_oversea_preload_task # noqa: E501
2172+
2173+
This method makes a synchronous HTTP request by default. To make an
2174+
asynchronous HTTP request, please pass async_req=True
2175+
>>> thread = api.submit_oversea_preload_task(body, async_req=True)
2176+
>>> result = thread.get()
2177+
2178+
:param async_req bool
2179+
:param SubmitOverseaPreloadTaskRequest body: (required)
2180+
:return: SubmitOverseaPreloadTaskResponse
2181+
If the method is called asynchronously,
2182+
returns the request thread.
2183+
"""
2184+
kwargs['_return_http_data_only'] = True
2185+
if kwargs.get('async_req'):
2186+
return self.submit_oversea_preload_task_with_http_info(body, **kwargs) # noqa: E501
2187+
else:
2188+
(data) = self.submit_oversea_preload_task_with_http_info(body, **kwargs) # noqa: E501
2189+
return data
2190+
2191+
def submit_oversea_preload_task_with_http_info(self, body, **kwargs): # noqa: E501
2192+
"""submit_oversea_preload_task # noqa: E501
2193+
2194+
This method makes a synchronous HTTP request by default. To make an
2195+
asynchronous HTTP request, please pass async_req=True
2196+
>>> thread = api.submit_oversea_preload_task_with_http_info(body, async_req=True)
2197+
>>> result = thread.get()
2198+
2199+
:param async_req bool
2200+
:param SubmitOverseaPreloadTaskRequest body: (required)
2201+
:return: SubmitOverseaPreloadTaskResponse
2202+
If the method is called asynchronously,
2203+
returns the request thread.
2204+
"""
2205+
2206+
all_params = ['body'] # noqa: E501
2207+
all_params.append('async_req')
2208+
all_params.append('_return_http_data_only')
2209+
all_params.append('_preload_content')
2210+
all_params.append('_request_timeout')
2211+
2212+
params = locals()
2213+
for key, val in six.iteritems(params['kwargs']):
2214+
if key not in all_params:
2215+
raise TypeError(
2216+
"Got an unexpected keyword argument '%s'"
2217+
" to method submit_oversea_preload_task" % key
2218+
)
2219+
params[key] = val
2220+
del params['kwargs']
2221+
# verify the required parameter 'body' is set
2222+
if self.api_client.client_side_validation and ('body' not in params or
2223+
params['body'] is None): # noqa: E501
2224+
raise ValueError("Missing the required parameter `body` when calling `submit_oversea_preload_task`") # noqa: E501
2225+
2226+
collection_formats = {}
2227+
2228+
path_params = {}
2229+
2230+
query_params = []
2231+
2232+
header_params = {}
2233+
2234+
form_params = []
2235+
local_var_files = {}
2236+
2237+
body_params = None
2238+
if 'body' in params:
2239+
body_params = params['body']
2240+
# HTTP header `Accept`
2241+
header_params['Accept'] = self.api_client.select_header_accept(
2242+
['application/json']) # noqa: E501
2243+
2244+
# HTTP header `Content-Type`
2245+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
2246+
['application/json']) # noqa: E501
2247+
2248+
# Authentication setting
2249+
auth_settings = ['volcengineSign'] # noqa: E501
2250+
2251+
return self.api_client.call_api(
2252+
'/SubmitOverseaPreloadTask/2022-03-01/mcdn/post/application_json/', 'POST',
2253+
path_params,
2254+
query_params,
2255+
header_params,
2256+
body=body_params,
2257+
post_params=form_params,
2258+
files=local_var_files,
2259+
response_type='SubmitOverseaPreloadTaskResponse', # noqa: E501
2260+
auth_settings=auth_settings,
2261+
async_req=params.get('async_req'),
2262+
_return_http_data_only=params.get('_return_http_data_only'),
2263+
_preload_content=params.get('_preload_content', True),
2264+
_request_timeout=params.get('_request_timeout'),
2265+
collection_formats=collection_formats)
2266+
21702267
def submit_preload_task(self, body, **kwargs): # noqa: E501
21712268
"""submit_preload_task # noqa: E501
21722269

volcenginesdkmcdn/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@
133133
from volcenginesdkmcdn.models.static_weight_for_describe_dns_schedule_static_weights_output import StaticWeightForDescribeDnsScheduleStaticWeightsOutput
134134
from volcenginesdkmcdn.models.sub_task_for_describe_content_task_by_task_id_output import SubTaskForDescribeContentTaskByTaskIdOutput
135135
from volcenginesdkmcdn.models.sub_task_for_list_content_tasks_output import SubTaskForListContentTasksOutput
136+
from volcenginesdkmcdn.models.submit_oversea_preload_task_request import SubmitOverseaPreloadTaskRequest
137+
from volcenginesdkmcdn.models.submit_oversea_preload_task_response import SubmitOverseaPreloadTaskResponse
136138
from volcenginesdkmcdn.models.submit_preload_task_request import SubmitPreloadTaskRequest
137139
from volcenginesdkmcdn.models.submit_preload_task_response import SubmitPreloadTaskResponse
138140
from volcenginesdkmcdn.models.submit_refresh_task_request import SubmitRefreshTaskRequest
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
# coding: utf-8
2+
3+
"""
4+
mcdn
5+
6+
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
7+
8+
OpenAPI spec version: common-version
9+
10+
Generated by: https://github.com/swagger-api/swagger-codegen.git
11+
"""
12+
13+
14+
import pprint
15+
import re # noqa: F401
16+
17+
import six
18+
19+
from volcenginesdkcore.configuration import Configuration
20+
21+
22+
class SubmitOverseaPreloadTaskRequest(object):
23+
"""NOTE: This class is auto generated by the swagger code generator program.
24+
25+
Do not edit the class manually.
26+
"""
27+
28+
"""
29+
Attributes:
30+
swagger_types (dict): The key is attribute name
31+
and the value is attribute type.
32+
attribute_map (dict): The key is attribute name
33+
and the value is json key in definition.
34+
"""
35+
swagger_types = {
36+
'area': 'str',
37+
'urls': 'str',
38+
'vendor': 'str'
39+
}
40+
41+
attribute_map = {
42+
'area': 'Area',
43+
'urls': 'Urls',
44+
'vendor': 'Vendor'
45+
}
46+
47+
def __init__(self, area=None, urls=None, vendor=None, _configuration=None): # noqa: E501
48+
"""SubmitOverseaPreloadTaskRequest - a model defined in Swagger""" # noqa: E501
49+
if _configuration is None:
50+
_configuration = Configuration()
51+
self._configuration = _configuration
52+
53+
self._area = None
54+
self._urls = None
55+
self._vendor = None
56+
self.discriminator = None
57+
58+
self.area = area
59+
self.urls = urls
60+
self.vendor = vendor
61+
62+
@property
63+
def area(self):
64+
"""Gets the area of this SubmitOverseaPreloadTaskRequest. # noqa: E501
65+
66+
67+
:return: The area of this SubmitOverseaPreloadTaskRequest. # noqa: E501
68+
:rtype: str
69+
"""
70+
return self._area
71+
72+
@area.setter
73+
def area(self, area):
74+
"""Sets the area of this SubmitOverseaPreloadTaskRequest.
75+
76+
77+
:param area: The area of this SubmitOverseaPreloadTaskRequest. # noqa: E501
78+
:type: str
79+
"""
80+
if self._configuration.client_side_validation and area is None:
81+
raise ValueError("Invalid value for `area`, must not be `None`") # noqa: E501
82+
83+
self._area = area
84+
85+
@property
86+
def urls(self):
87+
"""Gets the urls of this SubmitOverseaPreloadTaskRequest. # noqa: E501
88+
89+
90+
:return: The urls of this SubmitOverseaPreloadTaskRequest. # noqa: E501
91+
:rtype: str
92+
"""
93+
return self._urls
94+
95+
@urls.setter
96+
def urls(self, urls):
97+
"""Sets the urls of this SubmitOverseaPreloadTaskRequest.
98+
99+
100+
:param urls: The urls of this SubmitOverseaPreloadTaskRequest. # noqa: E501
101+
:type: str
102+
"""
103+
if self._configuration.client_side_validation and urls is None:
104+
raise ValueError("Invalid value for `urls`, must not be `None`") # noqa: E501
105+
106+
self._urls = urls
107+
108+
@property
109+
def vendor(self):
110+
"""Gets the vendor of this SubmitOverseaPreloadTaskRequest. # noqa: E501
111+
112+
113+
:return: The vendor of this SubmitOverseaPreloadTaskRequest. # noqa: E501
114+
:rtype: str
115+
"""
116+
return self._vendor
117+
118+
@vendor.setter
119+
def vendor(self, vendor):
120+
"""Sets the vendor of this SubmitOverseaPreloadTaskRequest.
121+
122+
123+
:param vendor: The vendor of this SubmitOverseaPreloadTaskRequest. # noqa: E501
124+
:type: str
125+
"""
126+
if self._configuration.client_side_validation and vendor is None:
127+
raise ValueError("Invalid value for `vendor`, must not be `None`") # noqa: E501
128+
129+
self._vendor = vendor
130+
131+
def to_dict(self):
132+
"""Returns the model properties as a dict"""
133+
result = {}
134+
135+
for attr, _ in six.iteritems(self.swagger_types):
136+
value = getattr(self, attr)
137+
if isinstance(value, list):
138+
result[attr] = list(map(
139+
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
140+
value
141+
))
142+
elif hasattr(value, "to_dict"):
143+
result[attr] = value.to_dict()
144+
elif isinstance(value, dict):
145+
result[attr] = dict(map(
146+
lambda item: (item[0], item[1].to_dict())
147+
if hasattr(item[1], "to_dict") else item,
148+
value.items()
149+
))
150+
else:
151+
result[attr] = value
152+
if issubclass(SubmitOverseaPreloadTaskRequest, dict):
153+
for key, value in self.items():
154+
result[key] = value
155+
156+
return result
157+
158+
def to_str(self):
159+
"""Returns the string representation of the model"""
160+
return pprint.pformat(self.to_dict())
161+
162+
def __repr__(self):
163+
"""For `print` and `pprint`"""
164+
return self.to_str()
165+
166+
def __eq__(self, other):
167+
"""Returns true if both objects are equal"""
168+
if not isinstance(other, SubmitOverseaPreloadTaskRequest):
169+
return False
170+
171+
return self.to_dict() == other.to_dict()
172+
173+
def __ne__(self, other):
174+
"""Returns true if both objects are not equal"""
175+
if not isinstance(other, SubmitOverseaPreloadTaskRequest):
176+
return True
177+
178+
return self.to_dict() != other.to_dict()

0 commit comments

Comments
 (0)