Skip to content

Commit 08fe868

Browse files
author
BitsAdmin
committed
Merge branch 'organization-Python-2022-01-01-online-1186-2025_05_21_17_09_06' into 'integration_2025-05-22_911100755970'
feat: [development task] organization-1186-Python (1244000) See merge request iaasng/volcengine-python-sdk!613
2 parents 7b142ca + 7c0a880 commit 08fe868

File tree

8 files changed

+920
-0
lines changed

8 files changed

+920
-0
lines changed

volcenginesdkorganization/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,12 @@
114114
from volcenginesdkorganization.models.sub_unit_list_for_list_organizational_units_for_parent_output import SubUnitListForListOrganizationalUnitsForParentOutput
115115
from volcenginesdkorganization.models.sub_unit_list_for_list_organizational_units_output import SubUnitListForListOrganizationalUnitsOutput
116116
from volcenginesdkorganization.models.tag_for_list_accounts_output import TagForListAccountsOutput
117+
from volcenginesdkorganization.models.tag_for_tag_resources_input import TagForTagResourcesInput
118+
from volcenginesdkorganization.models.tag_resources_request import TagResourcesRequest
119+
from volcenginesdkorganization.models.tag_resources_response import TagResourcesResponse
117120
from volcenginesdkorganization.models.target_for_list_targets_for_policy_output import TargetForListTargetsForPolicyOutput
121+
from volcenginesdkorganization.models.untag_resources_request import UntagResourcesRequest
122+
from volcenginesdkorganization.models.untag_resources_response import UntagResourcesResponse
118123
from volcenginesdkorganization.models.update_account_request import UpdateAccountRequest
119124
from volcenginesdkorganization.models.update_account_response import UpdateAccountResponse
120125
from volcenginesdkorganization.models.update_organizational_unit_request import UpdateOrganizationalUnitRequest

volcenginesdkorganization/api/organization_api.py

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4010,6 +4010,200 @@ def retry_change_account_secure_contact_info_with_http_info(self, body, **kwargs
40104010
_request_timeout=params.get('_request_timeout'),
40114011
collection_formats=collection_formats)
40124012

4013+
def tag_resources(self, body, **kwargs): # noqa: E501
4014+
"""tag_resources # noqa: E501
4015+
4016+
This method makes a synchronous HTTP request by default. To make an
4017+
asynchronous HTTP request, please pass async_req=True
4018+
>>> thread = api.tag_resources(body, async_req=True)
4019+
>>> result = thread.get()
4020+
4021+
:param async_req bool
4022+
:param TagResourcesRequest body: (required)
4023+
:return: TagResourcesResponse
4024+
If the method is called asynchronously,
4025+
returns the request thread.
4026+
"""
4027+
kwargs['_return_http_data_only'] = True
4028+
if kwargs.get('async_req'):
4029+
return self.tag_resources_with_http_info(body, **kwargs) # noqa: E501
4030+
else:
4031+
(data) = self.tag_resources_with_http_info(body, **kwargs) # noqa: E501
4032+
return data
4033+
4034+
def tag_resources_with_http_info(self, body, **kwargs): # noqa: E501
4035+
"""tag_resources # noqa: E501
4036+
4037+
This method makes a synchronous HTTP request by default. To make an
4038+
asynchronous HTTP request, please pass async_req=True
4039+
>>> thread = api.tag_resources_with_http_info(body, async_req=True)
4040+
>>> result = thread.get()
4041+
4042+
:param async_req bool
4043+
:param TagResourcesRequest body: (required)
4044+
:return: TagResourcesResponse
4045+
If the method is called asynchronously,
4046+
returns the request thread.
4047+
"""
4048+
4049+
all_params = ['body'] # noqa: E501
4050+
all_params.append('async_req')
4051+
all_params.append('_return_http_data_only')
4052+
all_params.append('_preload_content')
4053+
all_params.append('_request_timeout')
4054+
4055+
params = locals()
4056+
for key, val in six.iteritems(params['kwargs']):
4057+
if key not in all_params:
4058+
raise TypeError(
4059+
"Got an unexpected keyword argument '%s'"
4060+
" to method tag_resources" % key
4061+
)
4062+
params[key] = val
4063+
del params['kwargs']
4064+
# verify the required parameter 'body' is set
4065+
if self.api_client.client_side_validation and ('body' not in params or
4066+
params['body'] is None): # noqa: E501
4067+
raise ValueError("Missing the required parameter `body` when calling `tag_resources`") # noqa: E501
4068+
4069+
collection_formats = {}
4070+
4071+
path_params = {}
4072+
4073+
query_params = []
4074+
4075+
header_params = {}
4076+
4077+
form_params = []
4078+
local_var_files = {}
4079+
4080+
body_params = None
4081+
if 'body' in params:
4082+
body_params = params['body']
4083+
# HTTP header `Accept`
4084+
header_params['Accept'] = self.api_client.select_header_accept(
4085+
['application/json']) # noqa: E501
4086+
4087+
# HTTP header `Content-Type`
4088+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
4089+
['text/plain']) # noqa: E501
4090+
4091+
# Authentication setting
4092+
auth_settings = ['volcengineSign'] # noqa: E501
4093+
4094+
return self.api_client.call_api(
4095+
'/TagResources/2022-01-01/organization/get/text_plain/', 'GET',
4096+
path_params,
4097+
query_params,
4098+
header_params,
4099+
body=body_params,
4100+
post_params=form_params,
4101+
files=local_var_files,
4102+
response_type='TagResourcesResponse', # noqa: E501
4103+
auth_settings=auth_settings,
4104+
async_req=params.get('async_req'),
4105+
_return_http_data_only=params.get('_return_http_data_only'),
4106+
_preload_content=params.get('_preload_content', True),
4107+
_request_timeout=params.get('_request_timeout'),
4108+
collection_formats=collection_formats)
4109+
4110+
def untag_resources(self, body, **kwargs): # noqa: E501
4111+
"""untag_resources # noqa: E501
4112+
4113+
This method makes a synchronous HTTP request by default. To make an
4114+
asynchronous HTTP request, please pass async_req=True
4115+
>>> thread = api.untag_resources(body, async_req=True)
4116+
>>> result = thread.get()
4117+
4118+
:param async_req bool
4119+
:param UntagResourcesRequest body: (required)
4120+
:return: UntagResourcesResponse
4121+
If the method is called asynchronously,
4122+
returns the request thread.
4123+
"""
4124+
kwargs['_return_http_data_only'] = True
4125+
if kwargs.get('async_req'):
4126+
return self.untag_resources_with_http_info(body, **kwargs) # noqa: E501
4127+
else:
4128+
(data) = self.untag_resources_with_http_info(body, **kwargs) # noqa: E501
4129+
return data
4130+
4131+
def untag_resources_with_http_info(self, body, **kwargs): # noqa: E501
4132+
"""untag_resources # noqa: E501
4133+
4134+
This method makes a synchronous HTTP request by default. To make an
4135+
asynchronous HTTP request, please pass async_req=True
4136+
>>> thread = api.untag_resources_with_http_info(body, async_req=True)
4137+
>>> result = thread.get()
4138+
4139+
:param async_req bool
4140+
:param UntagResourcesRequest body: (required)
4141+
:return: UntagResourcesResponse
4142+
If the method is called asynchronously,
4143+
returns the request thread.
4144+
"""
4145+
4146+
all_params = ['body'] # noqa: E501
4147+
all_params.append('async_req')
4148+
all_params.append('_return_http_data_only')
4149+
all_params.append('_preload_content')
4150+
all_params.append('_request_timeout')
4151+
4152+
params = locals()
4153+
for key, val in six.iteritems(params['kwargs']):
4154+
if key not in all_params:
4155+
raise TypeError(
4156+
"Got an unexpected keyword argument '%s'"
4157+
" to method untag_resources" % key
4158+
)
4159+
params[key] = val
4160+
del params['kwargs']
4161+
# verify the required parameter 'body' is set
4162+
if self.api_client.client_side_validation and ('body' not in params or
4163+
params['body'] is None): # noqa: E501
4164+
raise ValueError("Missing the required parameter `body` when calling `untag_resources`") # noqa: E501
4165+
4166+
collection_formats = {}
4167+
4168+
path_params = {}
4169+
4170+
query_params = []
4171+
4172+
header_params = {}
4173+
4174+
form_params = []
4175+
local_var_files = {}
4176+
4177+
body_params = None
4178+
if 'body' in params:
4179+
body_params = params['body']
4180+
# HTTP header `Accept`
4181+
header_params['Accept'] = self.api_client.select_header_accept(
4182+
['application/json']) # noqa: E501
4183+
4184+
# HTTP header `Content-Type`
4185+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
4186+
['text/plain']) # noqa: E501
4187+
4188+
# Authentication setting
4189+
auth_settings = ['volcengineSign'] # noqa: E501
4190+
4191+
return self.api_client.call_api(
4192+
'/UntagResources/2022-01-01/organization/get/text_plain/', 'GET',
4193+
path_params,
4194+
query_params,
4195+
header_params,
4196+
body=body_params,
4197+
post_params=form_params,
4198+
files=local_var_files,
4199+
response_type='UntagResourcesResponse', # noqa: E501
4200+
auth_settings=auth_settings,
4201+
async_req=params.get('async_req'),
4202+
_return_http_data_only=params.get('_return_http_data_only'),
4203+
_preload_content=params.get('_preload_content', True),
4204+
_request_timeout=params.get('_request_timeout'),
4205+
collection_formats=collection_formats)
4206+
40134207
def update_account(self, body, **kwargs): # noqa: E501
40144208
"""update_account # noqa: E501
40154209

volcenginesdkorganization/models/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,12 @@
110110
from volcenginesdkorganization.models.sub_unit_list_for_list_organizational_units_for_parent_output import SubUnitListForListOrganizationalUnitsForParentOutput
111111
from volcenginesdkorganization.models.sub_unit_list_for_list_organizational_units_output import SubUnitListForListOrganizationalUnitsOutput
112112
from volcenginesdkorganization.models.tag_for_list_accounts_output import TagForListAccountsOutput
113+
from volcenginesdkorganization.models.tag_for_tag_resources_input import TagForTagResourcesInput
114+
from volcenginesdkorganization.models.tag_resources_request import TagResourcesRequest
115+
from volcenginesdkorganization.models.tag_resources_response import TagResourcesResponse
113116
from volcenginesdkorganization.models.target_for_list_targets_for_policy_output import TargetForListTargetsForPolicyOutput
117+
from volcenginesdkorganization.models.untag_resources_request import UntagResourcesRequest
118+
from volcenginesdkorganization.models.untag_resources_response import UntagResourcesResponse
114119
from volcenginesdkorganization.models.update_account_request import UpdateAccountRequest
115120
from volcenginesdkorganization.models.update_account_response import UpdateAccountResponse
116121
from volcenginesdkorganization.models.update_organizational_unit_request import UpdateOrganizationalUnitRequest
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
# coding: utf-8
2+
3+
"""
4+
organization
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 TagForTagResourcesInput(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+
'key': 'str',
37+
'value': 'str'
38+
}
39+
40+
attribute_map = {
41+
'key': 'Key',
42+
'value': 'Value'
43+
}
44+
45+
def __init__(self, key=None, value=None, _configuration=None): # noqa: E501
46+
"""TagForTagResourcesInput - a model defined in Swagger""" # noqa: E501
47+
if _configuration is None:
48+
_configuration = Configuration()
49+
self._configuration = _configuration
50+
51+
self._key = None
52+
self._value = None
53+
self.discriminator = None
54+
55+
self.key = key
56+
self.value = value
57+
58+
@property
59+
def key(self):
60+
"""Gets the key of this TagForTagResourcesInput. # noqa: E501
61+
62+
63+
:return: The key of this TagForTagResourcesInput. # noqa: E501
64+
:rtype: str
65+
"""
66+
return self._key
67+
68+
@key.setter
69+
def key(self, key):
70+
"""Sets the key of this TagForTagResourcesInput.
71+
72+
73+
:param key: The key of this TagForTagResourcesInput. # noqa: E501
74+
:type: str
75+
"""
76+
if self._configuration.client_side_validation and key is None:
77+
raise ValueError("Invalid value for `key`, must not be `None`") # noqa: E501
78+
if (self._configuration.client_side_validation and
79+
key is not None and len(key) > 128):
80+
raise ValueError("Invalid value for `key`, length must be less than or equal to `128`") # noqa: E501
81+
if (self._configuration.client_side_validation and
82+
key is not None and len(key) < 1):
83+
raise ValueError("Invalid value for `key`, length must be greater than or equal to `1`") # noqa: E501
84+
85+
self._key = key
86+
87+
@property
88+
def value(self):
89+
"""Gets the value of this TagForTagResourcesInput. # noqa: E501
90+
91+
92+
:return: The value of this TagForTagResourcesInput. # noqa: E501
93+
:rtype: str
94+
"""
95+
return self._value
96+
97+
@value.setter
98+
def value(self, value):
99+
"""Sets the value of this TagForTagResourcesInput.
100+
101+
102+
:param value: The value of this TagForTagResourcesInput. # noqa: E501
103+
:type: str
104+
"""
105+
if self._configuration.client_side_validation and value is None:
106+
raise ValueError("Invalid value for `value`, must not be `None`") # noqa: E501
107+
if (self._configuration.client_side_validation and
108+
value is not None and len(value) > 256):
109+
raise ValueError("Invalid value for `value`, length must be less than or equal to `256`") # noqa: E501
110+
111+
self._value = value
112+
113+
def to_dict(self):
114+
"""Returns the model properties as a dict"""
115+
result = {}
116+
117+
for attr, _ in six.iteritems(self.swagger_types):
118+
value = getattr(self, attr)
119+
if isinstance(value, list):
120+
result[attr] = list(map(
121+
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
122+
value
123+
))
124+
elif hasattr(value, "to_dict"):
125+
result[attr] = value.to_dict()
126+
elif isinstance(value, dict):
127+
result[attr] = dict(map(
128+
lambda item: (item[0], item[1].to_dict())
129+
if hasattr(item[1], "to_dict") else item,
130+
value.items()
131+
))
132+
else:
133+
result[attr] = value
134+
if issubclass(TagForTagResourcesInput, dict):
135+
for key, value in self.items():
136+
result[key] = value
137+
138+
return result
139+
140+
def to_str(self):
141+
"""Returns the string representation of the model"""
142+
return pprint.pformat(self.to_dict())
143+
144+
def __repr__(self):
145+
"""For `print` and `pprint`"""
146+
return self.to_str()
147+
148+
def __eq__(self, other):
149+
"""Returns true if both objects are equal"""
150+
if not isinstance(other, TagForTagResourcesInput):
151+
return False
152+
153+
return self.to_dict() == other.to_dict()
154+
155+
def __ne__(self, other):
156+
"""Returns true if both objects are not equal"""
157+
if not isinstance(other, TagForTagResourcesInput):
158+
return True
159+
160+
return self.to_dict() != other.to_dict()

0 commit comments

Comments
 (0)