Skip to content

Commit 858f302

Browse files
author
BitsAdmin
committed
Merge branch 'kms-Python-2021-02-18-online-639-2024_08_29_17_08_52' into 'integration_2024-09-05_424968328706'
feat: [development task] kms-639-Python (772881) See merge request iaasng/volcengine-python-sdk!378
2 parents 92f6eea + decfcd8 commit 858f302

11 files changed

+436
-6
lines changed

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 = "1.0.99"
6+
VERSION = "1.0.100"
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
@@ -67,7 +67,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
6767
self.default_headers[header_name] = header_value
6868
self.cookie = cookie
6969
# Set default User-Agent.
70-
self.user_agent = 'volcstack-python-sdk/1.0.99'
70+
self.user_agent = 'volcstack-python-sdk/1.0.100'
7171
self.client_side_validation = configuration.client_side_validation
7272

7373
def __del__(self):

volcenginesdkcore/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,5 +221,5 @@ def to_debug_report(self):
221221
"OS: {env}\n"\
222222
"Python Version: {pyversion}\n"\
223223
"Version of the API: 0.1.0\n"\
224-
"SDK Package Version: 1.0.99".\
224+
"SDK Package Version: 1.0.100".\
225225
format(env=sys.platform, pyversion=sys.version)

volcenginesdkkms/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
from volcenginesdkkms.models.decrypt_response import DecryptResponse
4242
from volcenginesdkkms.models.delete_key_material_request import DeleteKeyMaterialRequest
4343
from volcenginesdkkms.models.delete_key_material_response import DeleteKeyMaterialResponse
44+
from volcenginesdkkms.models.delete_keyring_request import DeleteKeyringRequest
45+
from volcenginesdkkms.models.delete_keyring_response import DeleteKeyringResponse
4446
from volcenginesdkkms.models.describe_key_request import DescribeKeyRequest
4547
from volcenginesdkkms.models.describe_key_response import DescribeKeyResponse
4648
from volcenginesdkkms.models.describe_keyrings_request import DescribeKeyringsRequest

volcenginesdkkms/api/kms_api.py

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,6 +1100,103 @@ def delete_key_material_with_http_info(self, body, **kwargs): # noqa: E501
11001100
_request_timeout=params.get('_request_timeout'),
11011101
collection_formats=collection_formats)
11021102

1103+
def delete_keyring(self, body, **kwargs): # noqa: E501
1104+
"""delete_keyring # noqa: E501
1105+
1106+
This method makes a synchronous HTTP request by default. To make an
1107+
asynchronous HTTP request, please pass async_req=True
1108+
>>> thread = api.delete_keyring(body, async_req=True)
1109+
>>> result = thread.get()
1110+
1111+
:param async_req bool
1112+
:param DeleteKeyringRequest body: (required)
1113+
:return: DeleteKeyringResponse
1114+
If the method is called asynchronously,
1115+
returns the request thread.
1116+
"""
1117+
kwargs['_return_http_data_only'] = True
1118+
if kwargs.get('async_req'):
1119+
return self.delete_keyring_with_http_info(body, **kwargs) # noqa: E501
1120+
else:
1121+
(data) = self.delete_keyring_with_http_info(body, **kwargs) # noqa: E501
1122+
return data
1123+
1124+
def delete_keyring_with_http_info(self, body, **kwargs): # noqa: E501
1125+
"""delete_keyring # noqa: E501
1126+
1127+
This method makes a synchronous HTTP request by default. To make an
1128+
asynchronous HTTP request, please pass async_req=True
1129+
>>> thread = api.delete_keyring_with_http_info(body, async_req=True)
1130+
>>> result = thread.get()
1131+
1132+
:param async_req bool
1133+
:param DeleteKeyringRequest body: (required)
1134+
:return: DeleteKeyringResponse
1135+
If the method is called asynchronously,
1136+
returns the request thread.
1137+
"""
1138+
1139+
all_params = ['body'] # noqa: E501
1140+
all_params.append('async_req')
1141+
all_params.append('_return_http_data_only')
1142+
all_params.append('_preload_content')
1143+
all_params.append('_request_timeout')
1144+
1145+
params = locals()
1146+
for key, val in six.iteritems(params['kwargs']):
1147+
if key not in all_params:
1148+
raise TypeError(
1149+
"Got an unexpected keyword argument '%s'"
1150+
" to method delete_keyring" % key
1151+
)
1152+
params[key] = val
1153+
del params['kwargs']
1154+
# verify the required parameter 'body' is set
1155+
if self.api_client.client_side_validation and ('body' not in params or
1156+
params['body'] is None): # noqa: E501
1157+
raise ValueError("Missing the required parameter `body` when calling `delete_keyring`") # noqa: E501
1158+
1159+
collection_formats = {}
1160+
1161+
path_params = {}
1162+
1163+
query_params = []
1164+
1165+
header_params = {}
1166+
1167+
form_params = []
1168+
local_var_files = {}
1169+
1170+
body_params = None
1171+
if 'body' in params:
1172+
body_params = params['body']
1173+
# HTTP header `Accept`
1174+
header_params['Accept'] = self.api_client.select_header_accept(
1175+
['application/json']) # noqa: E501
1176+
1177+
# HTTP header `Content-Type`
1178+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
1179+
['application/json']) # noqa: E501
1180+
1181+
# Authentication setting
1182+
auth_settings = ['volcengineSign'] # noqa: E501
1183+
1184+
return self.api_client.call_api(
1185+
'/DeleteKeyring/2021-02-18/kms/post/application_json/', 'POST',
1186+
path_params,
1187+
query_params,
1188+
header_params,
1189+
body=body_params,
1190+
post_params=form_params,
1191+
files=local_var_files,
1192+
response_type='DeleteKeyringResponse', # noqa: E501
1193+
auth_settings=auth_settings,
1194+
async_req=params.get('async_req'),
1195+
_return_http_data_only=params.get('_return_http_data_only'),
1196+
_preload_content=params.get('_preload_content', True),
1197+
_request_timeout=params.get('_request_timeout'),
1198+
collection_formats=collection_formats)
1199+
11031200
def describe_key(self, body, **kwargs): # noqa: E501
11041201
"""describe_key # noqa: E501
11051202

volcenginesdkkms/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
from volcenginesdkkms.models.decrypt_response import DecryptResponse
3838
from volcenginesdkkms.models.delete_key_material_request import DeleteKeyMaterialRequest
3939
from volcenginesdkkms.models.delete_key_material_response import DeleteKeyMaterialResponse
40+
from volcenginesdkkms.models.delete_keyring_request import DeleteKeyringRequest
41+
from volcenginesdkkms.models.delete_keyring_response import DeleteKeyringResponse
4042
from volcenginesdkkms.models.describe_key_request import DescribeKeyRequest
4143
from volcenginesdkkms.models.describe_key_response import DescribeKeyResponse
4244
from volcenginesdkkms.models.describe_keyrings_request import DescribeKeyringsRequest
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# coding: utf-8
2+
3+
"""
4+
kms
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 DeleteKeyringRequest(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+
'keyring_name': 'str'
37+
}
38+
39+
attribute_map = {
40+
'keyring_name': 'KeyringName'
41+
}
42+
43+
def __init__(self, keyring_name=None, _configuration=None): # noqa: E501
44+
"""DeleteKeyringRequest - a model defined in Swagger""" # noqa: E501
45+
if _configuration is None:
46+
_configuration = Configuration()
47+
self._configuration = _configuration
48+
49+
self._keyring_name = None
50+
self.discriminator = None
51+
52+
self.keyring_name = keyring_name
53+
54+
@property
55+
def keyring_name(self):
56+
"""Gets the keyring_name of this DeleteKeyringRequest. # noqa: E501
57+
58+
59+
:return: The keyring_name of this DeleteKeyringRequest. # noqa: E501
60+
:rtype: str
61+
"""
62+
return self._keyring_name
63+
64+
@keyring_name.setter
65+
def keyring_name(self, keyring_name):
66+
"""Sets the keyring_name of this DeleteKeyringRequest.
67+
68+
69+
:param keyring_name: The keyring_name of this DeleteKeyringRequest. # noqa: E501
70+
:type: str
71+
"""
72+
if self._configuration.client_side_validation and keyring_name is None:
73+
raise ValueError("Invalid value for `keyring_name`, must not be `None`") # noqa: E501
74+
if (self._configuration.client_side_validation and
75+
keyring_name is not None and len(keyring_name) > 31):
76+
raise ValueError("Invalid value for `keyring_name`, length must be less than or equal to `31`") # noqa: E501
77+
if (self._configuration.client_side_validation and
78+
keyring_name is not None and len(keyring_name) < 2):
79+
raise ValueError("Invalid value for `keyring_name`, length must be greater than or equal to `2`") # noqa: E501
80+
81+
self._keyring_name = keyring_name
82+
83+
def to_dict(self):
84+
"""Returns the model properties as a dict"""
85+
result = {}
86+
87+
for attr, _ in six.iteritems(self.swagger_types):
88+
value = getattr(self, attr)
89+
if isinstance(value, list):
90+
result[attr] = list(map(
91+
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
92+
value
93+
))
94+
elif hasattr(value, "to_dict"):
95+
result[attr] = value.to_dict()
96+
elif isinstance(value, dict):
97+
result[attr] = dict(map(
98+
lambda item: (item[0], item[1].to_dict())
99+
if hasattr(item[1], "to_dict") else item,
100+
value.items()
101+
))
102+
else:
103+
result[attr] = value
104+
if issubclass(DeleteKeyringRequest, dict):
105+
for key, value in self.items():
106+
result[key] = value
107+
108+
return result
109+
110+
def to_str(self):
111+
"""Returns the string representation of the model"""
112+
return pprint.pformat(self.to_dict())
113+
114+
def __repr__(self):
115+
"""For `print` and `pprint`"""
116+
return self.to_str()
117+
118+
def __eq__(self, other):
119+
"""Returns true if both objects are equal"""
120+
if not isinstance(other, DeleteKeyringRequest):
121+
return False
122+
123+
return self.to_dict() == other.to_dict()
124+
125+
def __ne__(self, other):
126+
"""Returns true if both objects are not equal"""
127+
if not isinstance(other, DeleteKeyringRequest):
128+
return True
129+
130+
return self.to_dict() != other.to_dict()
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# coding: utf-8
2+
3+
"""
4+
kms
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 DeleteKeyringResponse(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+
}
37+
38+
attribute_map = {
39+
}
40+
41+
def __init__(self, _configuration=None): # noqa: E501
42+
"""DeleteKeyringResponse - a model defined in Swagger""" # noqa: E501
43+
if _configuration is None:
44+
_configuration = Configuration()
45+
self._configuration = _configuration
46+
self.discriminator = None
47+
48+
def to_dict(self):
49+
"""Returns the model properties as a dict"""
50+
result = {}
51+
52+
for attr, _ in six.iteritems(self.swagger_types):
53+
value = getattr(self, attr)
54+
if isinstance(value, list):
55+
result[attr] = list(map(
56+
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
57+
value
58+
))
59+
elif hasattr(value, "to_dict"):
60+
result[attr] = value.to_dict()
61+
elif isinstance(value, dict):
62+
result[attr] = dict(map(
63+
lambda item: (item[0], item[1].to_dict())
64+
if hasattr(item[1], "to_dict") else item,
65+
value.items()
66+
))
67+
else:
68+
result[attr] = value
69+
if issubclass(DeleteKeyringResponse, dict):
70+
for key, value in self.items():
71+
result[key] = value
72+
73+
return result
74+
75+
def to_str(self):
76+
"""Returns the string representation of the model"""
77+
return pprint.pformat(self.to_dict())
78+
79+
def __repr__(self):
80+
"""For `print` and `pprint`"""
81+
return self.to_str()
82+
83+
def __eq__(self, other):
84+
"""Returns true if both objects are equal"""
85+
if not isinstance(other, DeleteKeyringResponse):
86+
return False
87+
88+
return self.to_dict() == other.to_dict()
89+
90+
def __ne__(self, other):
91+
"""Returns true if both objects are not equal"""
92+
if not isinstance(other, DeleteKeyringResponse):
93+
return True
94+
95+
return self.to_dict() != other.to_dict()

0 commit comments

Comments
 (0)