Skip to content

Commit d9df81d

Browse files
author
ci_volc_sdk_gen
committed
feat: auto generate for translate-Python-2025-03-01-online-1169-2025_05_15_17_30_03
1 parent e06c854 commit d9df81d

File tree

10 files changed

+558
-5
lines changed

10 files changed

+558
-5
lines changed

meta.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"lasted": "3.0.1",
3-
"meta_commit": "8a281723a8b0c275f2798381133db6ec88d10170"
2+
"lasted": "3.0.2",
3+
"meta_commit": "215ed7525c41ae4c1384fceea3d4ed3379eab3c9"
44
}

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from setuptools import setup, find_packages # noqa: H301
44

55
NAME = "volcengine-python-sdk"
6-
VERSION = "3.0.1"
6+
VERSION = "3.0.2"
77
# To install the library, run the following
88
#
99
# python setup.py install

volcenginesdkcore/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
6363
self.default_headers[header_name] = header_value
6464
self.cookie = cookie
6565
# Set default User-Agent.
66-
self.user_agent = 'volcstack-python-sdk/3.0.1'
66+
self.user_agent = 'volcstack-python-sdk/3.0.2'
6767
self.client_side_validation = configuration.client_side_validation
6868

6969
self.interceptor_chain = InterceptorChain()

volcenginesdkcore/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,5 +257,5 @@ def to_debug_report(self):
257257
"OS: {env}\n" \
258258
"Python Version: {pyversion}\n" \
259259
"Version of the API: 0.1.0\n" \
260-
"SDK Package Version: 3.0.1".\
260+
"SDK Package Version: 3.0.2".\
261261
format(env=sys.platform, pyversion=sys.version)

volcenginesdktranslate20250301/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@
2020

2121
# import models into sdk package
2222
from volcenginesdktranslate20250301.models.detected_language_list_for_lang_detect_output import DetectedLanguageListForLangDetectOutput
23+
from volcenginesdktranslate20250301.models.get_usage_request import GetUsageRequest
24+
from volcenginesdktranslate20250301.models.get_usage_response import GetUsageResponse
2325
from volcenginesdktranslate20250301.models.lang_detect_request import LangDetectRequest
2426
from volcenginesdktranslate20250301.models.lang_detect_response import LangDetectResponse
27+
from volcenginesdktranslate20250301.models.point_for_get_usage_output import PointForGetUsageOutput
2528
from volcenginesdktranslate20250301.models.point_for_translate_image_output import PointForTranslateImageOutput
2629
from volcenginesdktranslate20250301.models.query_audio_request import QueryAudioRequest
2730
from volcenginesdktranslate20250301.models.query_audio_response import QueryAudioResponse

volcenginesdktranslate20250301/api/translate20250301_api.py

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,103 @@ def __init__(self, api_client=None):
3333
api_client = volcenginesdkcore.ApiClient()
3434
self.api_client = api_client
3535

36+
def get_usage(self, body, **kwargs): # noqa: E501
37+
"""get_usage # noqa: E501
38+
39+
This method makes a synchronous HTTP request by default. To make an
40+
asynchronous HTTP request, please pass async_req=True
41+
>>> thread = api.get_usage(body, async_req=True)
42+
>>> result = thread.get()
43+
44+
:param async_req bool
45+
:param GetUsageRequest body: (required)
46+
:return: GetUsageResponse
47+
If the method is called asynchronously,
48+
returns the request thread.
49+
"""
50+
kwargs['_return_http_data_only'] = True
51+
if kwargs.get('async_req'):
52+
return self.get_usage_with_http_info(body, **kwargs) # noqa: E501
53+
else:
54+
(data) = self.get_usage_with_http_info(body, **kwargs) # noqa: E501
55+
return data
56+
57+
def get_usage_with_http_info(self, body, **kwargs): # noqa: E501
58+
"""get_usage # noqa: E501
59+
60+
This method makes a synchronous HTTP request by default. To make an
61+
asynchronous HTTP request, please pass async_req=True
62+
>>> thread = api.get_usage_with_http_info(body, async_req=True)
63+
>>> result = thread.get()
64+
65+
:param async_req bool
66+
:param GetUsageRequest body: (required)
67+
:return: GetUsageResponse
68+
If the method is called asynchronously,
69+
returns the request thread.
70+
"""
71+
72+
all_params = ['body'] # noqa: E501
73+
all_params.append('async_req')
74+
all_params.append('_return_http_data_only')
75+
all_params.append('_preload_content')
76+
all_params.append('_request_timeout')
77+
78+
params = locals()
79+
for key, val in six.iteritems(params['kwargs']):
80+
if key not in all_params:
81+
raise TypeError(
82+
"Got an unexpected keyword argument '%s'"
83+
" to method get_usage" % key
84+
)
85+
params[key] = val
86+
del params['kwargs']
87+
# verify the required parameter 'body' is set
88+
if self.api_client.client_side_validation and ('body' not in params or
89+
params['body'] is None): # noqa: E501
90+
raise ValueError("Missing the required parameter `body` when calling `get_usage`") # noqa: E501
91+
92+
collection_formats = {}
93+
94+
path_params = {}
95+
96+
query_params = []
97+
98+
header_params = {}
99+
100+
form_params = []
101+
local_var_files = {}
102+
103+
body_params = None
104+
if 'body' in params:
105+
body_params = params['body']
106+
# HTTP header `Accept`
107+
header_params['Accept'] = self.api_client.select_header_accept(
108+
['application/json']) # noqa: E501
109+
110+
# HTTP header `Content-Type`
111+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
112+
['application/json']) # noqa: E501
113+
114+
# Authentication setting
115+
auth_settings = ['volcengineSign'] # noqa: E501
116+
117+
return self.api_client.call_api(
118+
'/GetUsage/2025-03-01/translate/post/application_json/', 'POST',
119+
path_params,
120+
query_params,
121+
header_params,
122+
body=body_params,
123+
post_params=form_params,
124+
files=local_var_files,
125+
response_type='GetUsageResponse', # noqa: E501
126+
auth_settings=auth_settings,
127+
async_req=params.get('async_req'),
128+
_return_http_data_only=params.get('_return_http_data_only'),
129+
_preload_content=params.get('_preload_content', True),
130+
_request_timeout=params.get('_request_timeout'),
131+
collection_formats=collection_formats)
132+
36133
def lang_detect(self, body, **kwargs): # noqa: E501
37134
"""lang_detect # noqa: E501
38135

volcenginesdktranslate20250301/models/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@
1616

1717
# import models into model package
1818
from volcenginesdktranslate20250301.models.detected_language_list_for_lang_detect_output import DetectedLanguageListForLangDetectOutput
19+
from volcenginesdktranslate20250301.models.get_usage_request import GetUsageRequest
20+
from volcenginesdktranslate20250301.models.get_usage_response import GetUsageResponse
1921
from volcenginesdktranslate20250301.models.lang_detect_request import LangDetectRequest
2022
from volcenginesdktranslate20250301.models.lang_detect_response import LangDetectResponse
23+
from volcenginesdktranslate20250301.models.point_for_get_usage_output import PointForGetUsageOutput
2124
from volcenginesdktranslate20250301.models.point_for_translate_image_output import PointForTranslateImageOutput
2225
from volcenginesdktranslate20250301.models.query_audio_request import QueryAudioRequest
2326
from volcenginesdktranslate20250301.models.query_audio_response import QueryAudioResponse
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+
translate20250301
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 GetUsageRequest(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+
'_from': 'int',
37+
'service': 'str',
38+
'to': 'int'
39+
}
40+
41+
attribute_map = {
42+
'_from': 'From',
43+
'service': 'Service',
44+
'to': 'To'
45+
}
46+
47+
def __init__(self, _from=None, service=None, to=None, _configuration=None): # noqa: E501
48+
"""GetUsageRequest - a model defined in Swagger""" # noqa: E501
49+
if _configuration is None:
50+
_configuration = Configuration()
51+
self._configuration = _configuration
52+
53+
self.__from = None
54+
self._service = None
55+
self._to = None
56+
self.discriminator = None
57+
58+
self._from = _from
59+
self.service = service
60+
self.to = to
61+
62+
@property
63+
def _from(self):
64+
"""Gets the _from of this GetUsageRequest. # noqa: E501
65+
66+
67+
:return: The _from of this GetUsageRequest. # noqa: E501
68+
:rtype: int
69+
"""
70+
return self.__from
71+
72+
@_from.setter
73+
def _from(self, _from):
74+
"""Sets the _from of this GetUsageRequest.
75+
76+
77+
:param _from: The _from of this GetUsageRequest. # noqa: E501
78+
:type: int
79+
"""
80+
if self._configuration.client_side_validation and _from is None:
81+
raise ValueError("Invalid value for `_from`, must not be `None`") # noqa: E501
82+
83+
self.__from = _from
84+
85+
@property
86+
def service(self):
87+
"""Gets the service of this GetUsageRequest. # noqa: E501
88+
89+
90+
:return: The service of this GetUsageRequest. # noqa: E501
91+
:rtype: str
92+
"""
93+
return self._service
94+
95+
@service.setter
96+
def service(self, service):
97+
"""Sets the service of this GetUsageRequest.
98+
99+
100+
:param service: The service of this GetUsageRequest. # noqa: E501
101+
:type: str
102+
"""
103+
if self._configuration.client_side_validation and service is None:
104+
raise ValueError("Invalid value for `service`, must not be `None`") # noqa: E501
105+
106+
self._service = service
107+
108+
@property
109+
def to(self):
110+
"""Gets the to of this GetUsageRequest. # noqa: E501
111+
112+
113+
:return: The to of this GetUsageRequest. # noqa: E501
114+
:rtype: int
115+
"""
116+
return self._to
117+
118+
@to.setter
119+
def to(self, to):
120+
"""Sets the to of this GetUsageRequest.
121+
122+
123+
:param to: The to of this GetUsageRequest. # noqa: E501
124+
:type: int
125+
"""
126+
if self._configuration.client_side_validation and to is None:
127+
raise ValueError("Invalid value for `to`, must not be `None`") # noqa: E501
128+
129+
self._to = to
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(GetUsageRequest, 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, GetUsageRequest):
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, GetUsageRequest):
176+
return True
177+
178+
return self.to_dict() != other.to_dict()

0 commit comments

Comments
 (0)