Skip to content

Commit 1df702d

Browse files
author
BitsAdmin
committed
Merge branch 'sts-Python-2018-01-01-online-1781-2025_11_05_14_26_34' into 'integration_2025-11-06_1076451254274'
feat: [development task] sts-1781-Python (1807088) See merge request iaasng/volcengine-python-sdk!901
2 parents a17e9e5 + 6803323 commit 1df702d

File tree

5 files changed

+397
-0
lines changed

5 files changed

+397
-0
lines changed

volcenginesdksts/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@
2323
from volcenginesdksts.models.assume_role_response import AssumeRoleResponse
2424
from volcenginesdksts.models.assumed_role_user_for_assume_role_output import AssumedRoleUserForAssumeRoleOutput
2525
from volcenginesdksts.models.credentials_for_assume_role_output import CredentialsForAssumeRoleOutput
26+
from volcenginesdksts.models.get_caller_identity_request import GetCallerIdentityRequest
27+
from volcenginesdksts.models.get_caller_identity_response import GetCallerIdentityResponse
2628
from volcenginesdksts.models.tag_for_assume_role_input import TagForAssumeRoleInput

volcenginesdksts/api/sts_api.py

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,100 @@ def assume_role_with_http_info(self, body, **kwargs): # noqa: E501
129129
_preload_content=params.get('_preload_content', True),
130130
_request_timeout=params.get('_request_timeout'),
131131
collection_formats=collection_formats)
132+
133+
def get_caller_identity(self, body, **kwargs): # noqa: E501
134+
"""get_caller_identity # noqa: E501
135+
136+
This method makes a synchronous HTTP request by default. To make an
137+
asynchronous HTTP request, please pass async_req=True
138+
>>> thread = api.get_caller_identity(body, async_req=True)
139+
>>> result = thread.get()
140+
141+
:param async_req bool
142+
:param GetCallerIdentityRequest body: (required)
143+
:return: GetCallerIdentityResponse
144+
If the method is called asynchronously,
145+
returns the request thread.
146+
"""
147+
kwargs['_return_http_data_only'] = True
148+
if kwargs.get('async_req'):
149+
return self.get_caller_identity_with_http_info(body, **kwargs) # noqa: E501
150+
else:
151+
(data) = self.get_caller_identity_with_http_info(body, **kwargs) # noqa: E501
152+
return data
153+
154+
def get_caller_identity_with_http_info(self, body, **kwargs): # noqa: E501
155+
"""get_caller_identity # noqa: E501
156+
157+
This method makes a synchronous HTTP request by default. To make an
158+
asynchronous HTTP request, please pass async_req=True
159+
>>> thread = api.get_caller_identity_with_http_info(body, async_req=True)
160+
>>> result = thread.get()
161+
162+
:param async_req bool
163+
:param GetCallerIdentityRequest body: (required)
164+
:return: GetCallerIdentityResponse
165+
If the method is called asynchronously,
166+
returns the request thread.
167+
"""
168+
169+
all_params = ['body'] # noqa: E501
170+
all_params.append('async_req')
171+
all_params.append('_return_http_data_only')
172+
all_params.append('_preload_content')
173+
all_params.append('_request_timeout')
174+
175+
params = locals()
176+
for key, val in six.iteritems(params['kwargs']):
177+
if key not in all_params:
178+
raise TypeError(
179+
"Got an unexpected keyword argument '%s'"
180+
" to method get_caller_identity" % key
181+
)
182+
params[key] = val
183+
del params['kwargs']
184+
# verify the required parameter 'body' is set
185+
if self.api_client.client_side_validation and ('body' not in params or
186+
params['body'] is None): # noqa: E501
187+
raise ValueError("Missing the required parameter `body` when calling `get_caller_identity`") # noqa: E501
188+
189+
collection_formats = {}
190+
191+
path_params = {}
192+
193+
query_params = []
194+
195+
header_params = {}
196+
197+
form_params = []
198+
local_var_files = {}
199+
200+
body_params = None
201+
if 'body' in params:
202+
body_params = params['body']
203+
# HTTP header `Accept`
204+
header_params['Accept'] = self.api_client.select_header_accept(
205+
['application/json']) # noqa: E501
206+
207+
# HTTP header `Content-Type`
208+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
209+
['application/x-www-form-urlencoded']) # noqa: E501
210+
211+
# Authentication setting
212+
auth_settings = ['volcengineSign'] # noqa: E501
213+
214+
return self.api_client.call_api(
215+
'/GetCallerIdentity/2018-01-01/sts/post/application_x-www-form-urlencoded/', 'POST',
216+
path_params,
217+
query_params,
218+
header_params,
219+
body=body_params,
220+
post_params=form_params,
221+
files=local_var_files,
222+
response_type='GetCallerIdentityResponse', # noqa: E501
223+
auth_settings=auth_settings,
224+
async_req=params.get('async_req'),
225+
_return_http_data_only=params.get('_return_http_data_only'),
226+
_preload_content=params.get('_preload_content', True),
227+
_request_timeout=params.get('_request_timeout'),
228+
collection_formats=collection_formats)

volcenginesdksts/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,6 @@
1919
from volcenginesdksts.models.assume_role_response import AssumeRoleResponse
2020
from volcenginesdksts.models.assumed_role_user_for_assume_role_output import AssumedRoleUserForAssumeRoleOutput
2121
from volcenginesdksts.models.credentials_for_assume_role_output import CredentialsForAssumeRoleOutput
22+
from volcenginesdksts.models.get_caller_identity_request import GetCallerIdentityRequest
23+
from volcenginesdksts.models.get_caller_identity_response import GetCallerIdentityResponse
2224
from volcenginesdksts.models.tag_for_assume_role_input import TagForAssumeRoleInput
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+
sts
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 GetCallerIdentityRequest(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+
"""GetCallerIdentityRequest - 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(GetCallerIdentityRequest, 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, GetCallerIdentityRequest):
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, GetCallerIdentityRequest):
93+
return True
94+
95+
return self.to_dict() != other.to_dict()

0 commit comments

Comments
 (0)